﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 
    <!--============================================PasswordBox配色======================================================-->
    <SolidColorBrush x:Key="PasswordBox_BgColor">#FFFFFFFF</SolidColorBrush>
    
    <!--PasswordBox-->
    <Style TargetType="{x:Type PasswordBox}">
        <Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
        <Setter Property="Background" Value="{StaticResource PasswordBox_BgColor}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
        <Setter Property="BorderThickness" Value="0.7"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="PasswordBox">
                    <Border x:Name="Bd"  BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"  SnapsToDevicePixels="true">
                        <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"  Background="{x:Null}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="BorderThickness" Value="0.5"/>
                            <Setter Property="Foreground" Value="{DynamicResource EnabledColor}"/>
                            <Setter Property="BorderBrush"  Value="{DynamicResource EnabledColor}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>